package com.ptp.backendcertms.api.internal.constant.cert;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 证书状态枚举
 *
 * @author songcongcong
 * @date 2025/5/6
 */
@Getter
@AllArgsConstructor
public enum CertificateStatusEnum {
    /**
     * 证书状态
     */
    valid("有效"),
    pause("暂停"),
    cancel("注销"),
    revoke("撤销");

    private final String value;

    public static CertificateStatusEnum getByValue(String certificateStatus) {
        return Arrays.stream(CertificateStatusEnum.values()).filter(t -> t.value.equals(certificateStatus)).findFirst().orElse(CertificateStatusEnum.valid);
    }
}
